package com.agadasom.common;
/**
 * Extension of Math Class, but did not extend Math class.
 * @author Seung Hoon Juan Lee
 * @version 1.0
 * @since 2013.02.01
 */
public class MathExt {
	/**
	 * static method
	 * @param a double 
	 * @param b int rounding position
	 * @return double 
	 */
	static public double round(double a, int b){
		b *= -1;
		double pow = Math.pow(10.0,(double)b);
		return ( Math.round(a * pow) / pow );		
	}
	/**
	 * static method
	 * @param a float
	 * @param b int rounding position
	 * @return float
	 */
	static public float round(float a, int b){
		b *= -1;
		double pow =  Math.pow(10.0,(double)b);
		return (float)( Math.round(a * pow) / pow );		
	}
}
